<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<button @click="jia1" type="button">按钮 num+1</button>
			{{num}}
			<button @click="jiang1" type="button">按钮 num-1</button>
			
			<!-- <button @click="num+=1" type="button">按钮 num</button> -->
		</div>
	</body>
	<script type="text/javascript">
		new Vue({
			el:"#app",
			data:{
				num:1
			},
			methods:{
				jia1(){
					this.num+=1
				},
				jiang1(){
					this.num-=1
				}
			}
		})
	</script>
</html>
